/**
 * Created by Thyiad on 2017/11/15.
 */

const demoFilePath = 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100';

const data={
  token: 'mocktoken',
  companyInfo:{"name":"王刀","establishDate":"2007-06-06","owereExperience":"","TestDateRange1":"2007-06-06","TestDateRange2":"","capital":"2000.000000 万元","scope":"普通货物运输；汽车配件销售；货物配载、仓储；汽车租赁（不含出租营运）。","homepage":"http://www.hfaywl.com/index.html","employNum":"100人以上","totalCapital":"2000.000000","title":"合肥安运物流有限公司","license":"","entType":"有限责任公司(自然人投资或控股)","yynx":"","socailCode":"9134012166291416X9","contact":"","phone":"","officeAddr":"长丰县岗集镇","fax":"","owerName":"王刀"},
  creditInfo: {"amount":"1000","isPending":true},
  carList:[{id:1,carno:'湘ABCDEFG', model:'大众'},{id:2,carno:'湘ABCDEFG', model:'东风'},{id:3,carno:'湘ABCDEFG', model:'春风'}],
  driverList:[{"name":"张森森","sex":"男","birth":"1996-07-27","addr":"安徽省合肥市蜀山区","cardno":"341221199607278526","cardType":"A1","age":"5","car":"皖AZL011","education":"本科","xxx":"中国人寿保险","contact":"张宏:13093396738","joinDate":"2017-10-10","type":"自由"}, {"name":"相凡","sex":"男","birth":"1996-08-17","addr":"安徽省合肥市经开区","cardno":"312541199607278526","cardType":"A2","age":"6","car":"皖AZL251","education":"本科","xxx":"中国人寿保险","contact":"相似:15523696738","joinDate":"2017-10-10","type":"挂靠"}, {"name":"汤志胜","sex":"男","birth":"1995-04-20","addr":"安徽省合肥市蜀山区","cardno":"341221199505678526","cardType":"A1","age":"4","car":"皖AIK521","education":"本科","xxx":"中国人寿保险","contact":"汤尤为:15555879875","joinDate":"2017-10-10","type":"挂靠"}, {"name":"李太猛","sex":"男","birth":"1996-03-15","addr":"安徽省合肥市瑶海区","cardno":"34122115667278526","cardType":"A1","age":"6","car":"皖A31011","education":"本科","xxx":"中国人寿保险","contact":"李当客:17755256895","joinDate":"2017-10-10","type":"自由"}, {"name":"张玉顺","sex":"男","birth":"1997-05-24","addr":"安徽省合肥市蜀山区","cardno":"34122119956821456","cardType":"A1","age":"8","car":"皖A58934","education":"本科","xxx":"中国人寿保险","contact":"张大数:18856892588","joinDate":"2017-10-10","type":"挂靠"}],
  orderList:[{accountPeriod:'一个月',status:'待还款',createDate:'2017-11-06', amount:"1,000,000.00元", paybackTime:'2017-12-06',paybackActualTime:null,rate:5,orderNo:'TEST2017110314237861H',productType:'信用贷',paybackAmount:'1,004,389.23元'},{accountPeriod:'一个月',status:'待还款',createDate:'2017-10-20', amount:"500,000.00元", paybackTime:'2017-11-20',paybackActualTime:null,rate:5,orderNo:'TEST2017102009237861H',productType:'信用贷',paybackAmount:'502,194.62元'}],
  checkList:[{id:1, appId:'编号1', subId:'0', type:'0', status:'0',remarks:'备注', 'createDate':'2017-01-01', updateDate:'2017-10-10',attachList:[{name:'营业执照',path:demoFilePath},{name:'银行流水',path:demoFilePath},{name:'营业执照B',path:demoFilePath}]}],
  msgList: [{"status":"1","title": "您的订单TEST2017110112345678还有3天就要还款了","type":"1","type_text":"产品消息——还款提醒","recive_time":"2017-09-09 00:00:00"},{"status":"1","title": "您的放款申请TEST123498765已通过","type":"3","type_text":"审核消息——放款申请","recive_time":"2017-09-09 14:00:00"},{"status":"1","title": "您的账号在合肥201.201.201.201异地登录","type":"2","type_text":"安全消息——异地登录","recive_time":"2017-09-11 00:00:00"},{"status":"0","title": "您的放款申请TEST123498762未通过，要求补件","type":"3","type_text":"审核消息——放款申请","recive_time":"2017-09-11 00:00:00"},{"status":"0","title": "您的展期申请TEST123498761已通过","type":"3","type_text":"审核消息——展期申请","recive_time":"2017-09-11 00:00:00"}],
  upload: demoFilePath,
}

export default {
  login:options=>{
    return data.token;
  },
  register:options=>{
    return true;
  },
  getCompanyInfo:options=>{
    return data.companyInfo;
  },
  editCompanyInfo:options=>{
    return JSON.parse(options.body);
  },
  getCarList:options=>{
    return data.carList
  },
  addCar:options=>{
    let newCar = JSON.parse(options.body);
    newCar.id=Math.round(Math.random()*1000);
    return newCar;
  },
  editCar:options=>{
    let newCar = JSON.parse(options.body);
    return newCar;
  },
  deleteCar:options=>{
    return true;
  },
  getDriverList:options=>{
    return data.driverList
  },
  addDriver:options=>{
    let newDriver = JSON.parse(options.body);
    newDriver.id=Math.round(Math.random()*1000);
    return newDriver;
  },
  editDriver:options=>{
    let newDriver = JSON.parse(options.body);
    return newDriver;
  },
  deleteDriver:options=>{
    return true;
  },
  upload: options=> {
    return data.upload;
  },
  getCreditInfo:options=>{
    return data.creditInfo;
  },
  getOrderList:options=>{
    return data.orderList;
  },
  getCheckList:options=>{
    return data.checkList;
  },
  getMsg:options=>{
    return data.msgList;
  },
}
